/*
 * @Author: xianfuyou
 * @Date: 2022-04-08 14:30:59
 * @LastEditors: your name
 * @LastEditTime: 2022-04-08 16:34:48
 * @Description: file content
 */
let initState = { orderLists: [], count: 0 }
export default function orderReducer(preState = initState, action) {
  // console.log(preState,action);
  const { type, data } = action
  // console.log(type, data)
  switch (type) {
    case 'putOrderLists':
      return Object.assign({}, preState, { orderLists: data })
    case 'putCount':
      return Object.assign({}, preState, { count: data })
    case 'putAllPrice':
      return Object.assign({}, preState, { allPrice: data })
    default:
      return preState
  }
}